<?php

namespace common\services;

use common\models\DictModel;

class Dict
{
    public static function getAll($name, $return_type = 1)
    {
        $rows = DictModel::find()->select('id,detail')->where('name=:name and is_deleted=0 and is_disabled=0', [':name' => $name])->asArray()->all();

    }

    public static function productSpecs()
    {
        return DictModel::find()->select('content')->where("name='product.spec' and is_deleted=0 and is_disabled=0")->column();
    }

    public static function productUnits()
    {
        return DictModel::find()->select('content')->where("name='product.unit' and is_deleted=0 and is_disabled=0")->column();
    }
}